package com.spark.lola.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.spark.lola.entity.warehouse.OrderInfo;
import com.spark.lola.mapper.OrderInfoMapper;
import com.spark.lola.service.IOrderInfoService;
import com.spark.lola.support.mybatis.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 采购入库单 服务实现类
 * </p>
 * @author dengyejun
 * @since 2020-06-15
 */
@Service
public class OrderInfoServiceImpl extends BaseServiceImpl<OrderInfoMapper, OrderInfo> implements IOrderInfoService {

    @Override
    public List<String> getKeysByTradeDay(String start, String end) {
        List<String> keys =new ArrayList<>();
        QueryWrapper<OrderInfo> query = new QueryWrapper<>();
        query.select("store_id,no");
        query.between("trade_day", start, end);
        List<OrderInfo> lst = baseMapper.selectList(query);
        lst.forEach(o->keys.add(o.getStoreId()+":"+o.getNo()));
        return keys;
    }
}
